﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyEFDemo
{
    internal class Program
    {
        static void Main(string[] args)
        {
            KTStoreEntities db = new KTStoreEntities();
            Console.WriteLine("商品数据项数：{0}\n", db.ProductSet.Count());
            IEnumerable<Product> products = db.ProductSet.Select(x => x);
            foreach (Product prod in products)
            {
                int id = prod.Id;
                string name = prod.Name;
                int? price = prod.UnitPrice;
                string category = prod.Category;
                Console.WriteLine("{3}\t 订价：{2}\t{0}\t{1}", id, name, price, category);
            }
            Console.ReadKey();
        }
    }
}
